import {BaseModel} from "@/model/BaseModel";

export enum BcTemplateStateEnum {
    InActive = 0,
    Await = 1,
    Delete = 2,
    Pass = 3,
    Reject = 4
}

export class BcTemplateModel extends BaseModel{

    public id: string;

    public name: string;

    public thumbnail: string;

    public thumbFullPath: string;

    public description: string;

    public config: string;

    public state: number;

    public updateName: string;

    public updateId: string;

    public updateTime: Date;

    public createName: string;

    public createId: string;

    public createTime: Date;

    public static StateMap = [
        {label: '停用', value: BcTemplateStateEnum.InActive, type: 'danger'},
        {label: '待审批', value: BcTemplateStateEnum.Await, type: 'warning'},
        {label: '已通过', value: BcTemplateStateEnum.Pass, type: 'success'},
        {label: '已拒绝', value:BcTemplateStateEnum.Reject, type: 'danger'}
    ]

    public static getStateItem = (val: number) => {
        return BcTemplateModel.StateMap.find(item => item.value === val)
    }

}